/******************************************************************************
 *  Copyright 2013 Bernhard Grünewaldt                                        *
 *                                                                            *
 *  Licensed under the Apache License, Version 2.0 (the "License");           *
 *  you may not use this file except in compliance with the License.          *
 *  You may obtain a copy of the License at                                   *
 *                                                                            *
 *      http://www.apache.org/licenses/LICENSE-2.0                            *
 *                                                                            *
 *  Unless required by applicable law or agreed to in writing, software       *
 *  distributed under the License is distributed on an "AS IS" BASIS,         *
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  *
 *  See the License for the specific language governing permissions and       *
 *  limitations under the License.                                            *
 ******************************************************************************/
package com.google.code.greenwood.confluencemavenreleaseinfomacro.pojo;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;

public class ReleaseInformation extends BaseArtifactInformation {

	protected Date lastCacheUpdate = null;
	
	private String urlToReleasePomXml;
	
	private String baseUrlToMavenRepo;

	private Collection<ModuleReleaseVersion> modules = new ArrayList<ModuleReleaseVersion>();

	public void addModules(Collection<ModuleReleaseVersion> modules) {
		this.modules.addAll(modules);
	}
	
	public Collection<ModuleReleaseVersion> getModules() {
		return modules;
	}
	
	public ModuleReleaseVersion getModulByModulename(String modulename) {
		for (ModuleReleaseVersion m : modules) {
			if (m.getName().equalsIgnoreCase(modulename)) {
				return m;
			}
		}
		return null;
	}

	public Date getLastCacheUpdate() {
		return lastCacheUpdate;
	}

	public void setLastCacheUpdate(Date lastCacheUpdate) {
		this.lastCacheUpdate = lastCacheUpdate;
	}

	public String getUrlToReleasePomXml() {
		return urlToReleasePomXml;
	}

	public void setUrlToReleasePomXml(String urlToReleasePomXmlKey) {
		this.urlToReleasePomXml = urlToReleasePomXmlKey;
	}

	public String getBaseUrlToMavenRepo() {
		return baseUrlToMavenRepo;
	}

	public void setBaseUrlToMavenRepo(String baseUrlToMavenRepo) {
		this.baseUrlToMavenRepo = baseUrlToMavenRepo;
	}

	

	
	
}
